<?php
class Search extends Public_Controller{
	public $config_shop;
	function __construct(){
		parent::__construct();
		$this->load->model('search_m');
		$this->load->language('shop/shop',$this->lang_current);
		$this->template->append_css('shop.css');
		
	}
	
	function index(){
		//echo 2;exit;
		$gets = $this->input->get();

		$query_string = http_build_query($gets);

		
		$module = $this->input->get('m');
		$keyword = $this->input->get('keyword');
		
		//$this->load->model('search_m');
		$model = $this->search_m->result($module,$keyword);
		//shop
		$this->config_shop = $this->settings_m->get_config('shop');
		$thumb_width = $this->config_shop->thumbs_width;
		$this->template
			->append_css('search.css')
			->append_css('kun.pagination.css')
			->title(lang('global:search'))
			->set_breadcrumb(lang('global:search'))
			->set('model',$model)
			->set('shop_width',$thumb_width)
			->set('keyword',$keyword)
			->set('query_string',$query_string)
			->build('result');
			
	}
}